<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="<?php echo base_url(); ?>css/bootstrap.min.css" rel="stylesheet" media="screen"/>
        <link href="<?php echo base_url(); ?>css/style.css" rel="stylesheet" media="screen"/>
        <link href="<?php echo base_url(); ?>css/jquery.fancybox.css" rel="stylesheet" media="screen"/>
        <script type="text/javascript" src="<?php echo base_url(); ?>js/jquery-1.8.3.min.js"></script>
        <script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.fancybox.pack.js"></script>
        <script type="text/javascript" src="<?php echo base_url(); ?>js/bootstrap.min.js"></script>
        <style type="text/css">
            body{
                overflow: hidden;
                height: 200px;
            }

            .licek{
                max-height: 32px;
                max-width: 32px;
            }
        </style>
    </head>
    <body>
        <div class="container" style="margin-top:-70px;">
            <div class="row">
                <div class="span7">
                    <form class="form-search">
                        <center><input type="text" class="input" placeholder="Nama Mahasiswa" id="search"/></center>
                        <input type="hidden" id="id_group" value="<?php echo $id; ?>"/>
                    </form>

                    <table class="table table-striped">
<!--                        <thead>
                            <tr>
                                <th>NIM</th>
                                <th>Nama Lengkap</th>
                                <th></th>
                            </tr>
                        </thead>-->

                        <tbody id="resulttab">
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        
        <script type="text/javascript">
            var delay = (function(){
                var timer = 0;
                return function(callback, ms){
                    clearTimeout (timer);
                    timer = setTimeout(callback, ms);
                };
            })();
            
            $('#search').keyup(function() {
                delay(function(){
                    if($('#search').val() !== ""){
                        $.post("<?php echo site_url('dosen/cek_member'); ?>", { q:$('#search').val(), id_group:$('#id_group').val() }, function(data){
                            $('#resulttab').after().html(data);
                        });
                    }
                }, 300 );
            });
        </script>
    </body>
</html>